import request from '@/utils/request'

export function add(data) {
  return request({
    url: 'api/wareCheck/addOrSave',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'api/wareCheck/',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/wareCheck/addOrSave',
    method: 'post',
    data
  })
}

export function copy(data) {
  return request({
    url: 'api/wareCheck/copy',
    method: 'post',
    data
  })
}

export function exportDe(data) {
  return request({
    url: 'api/wareCheck/export',
    method: 'post',
    data
  })
}

export function importDe(data) {
  return request({
    url: 'api/wareCheck/import',
    method: 'post',
    data
  })
}

export function passOrReject(data) {
  const obj = {
    url: 'api/wareCheck/passOrReject',
    method: 'post',
    data
  }
  return request(obj)
}

export function addDirect(data) {
  const obj = {
    url: 'api/wareCheck/addDirect',
    method: 'post',
    data
  }
  return request(obj)
}

export function addOrSub(data) {
  const obj = {
    url: 'api/wareCheck/addOrSub',
    method: 'post',
    data
  }
  return request(obj)
}
export function checkAppend(data) {
  const obj = {
    url: 'api/wareCheck/checkAppend',
    method: 'post',
    data
  }
  return request(obj)
}

export function checkDynamic(data) {
  const obj = {
    url: 'api/wareCheck/checkDynamic',
    method: 'post',
    data
  }
  return request(obj)
}
export function checkFinish(data) {
  const obj = {
    url: 'api/wareCheck/checkFinish',
    method: 'post',
    data
  }
  return request(obj)
}
export function detail(data) {
  return request({
    url: 'api/wareCheck/detail',
    method: 'get',
    data
  })
}
export function exportDetail(data) {
  return request({
    url: 'api/wareCheck/exportDetail',
    method: 'get',
    data
  })
}
export function enableOrDisable(data) {
  const obj = {
    url: 'api/wareCheck/passOrReject',
    method: 'post',
    data
  }
  return request(obj)
}
export function removeDetail(data) {
  const obj = {
    url: 'api/wareCheck/removeDetail',
    method: 'post',
    data
  }
  return request(obj)
}
export function goodsMerge(data) {
  const obj = {
    url: 'api/wareCheck/goodsMerge',
    method: 'post',
    data
  }
  return request(obj)
}
export function orderMerge(data) {
  const obj = {
    url: 'api/wareCheck/orderMerge',
    method: 'post',
    data
  }
  return request(obj)
}
export function print(data) {
  const obj = {
    url: 'api/wareCheck/print',
    method: 'post',
    responseType: 'blob',
    data
  }
  return request(obj)
}
export default { add, edit, copy, exportDe, importDe, del, passOrReject,addDirect,addOrSub,checkAppend,checkDynamic,checkFinish,detail,exportDetail,enableOrDisable,removeDetail,goodsMerge,orderMerge,print }
